The return value from the method is only suitable for passing to
$db->insert(). To get the inserted ID, you need to call $db->insertId()
even if $db->nextSequenceValue() returned non-null.
Bug: T164900
Change-Id: I6beb6243ccb9425372623307ef23ae6571ce8c0d
$dbw->insert( 'revision', $row, __METHOD__ );
- $this->mId = $rev_id !== null ? $rev_id : $dbw->insertId();
+ if ( $this->mId === null ) {
+ // Only if nextSequenceValue() was called
+ $this->mId = $dbw->insertId();
+ }
// Assertion to try to catch T92046
if ( (int)$this->mId === 0 ) {
}
$dbw->insert( 'logging', $data, __METHOD__ );
- $this->id = !is_null( $id ) ? $id : $dbw->insertId();
+ $this->id = $dbw->insertId();
$rows = [];
foreach ( $relations as $tag => $values ) {
'log_params' => $this->params
];
$dbw->insert( 'logging', $data, __METHOD__ );
- $newId = !is_null( $log_id ) ? $log_id : $dbw->insertId();
+ $newId = $dbw->insertId();
# And update recentchanges
if ( $this->updateRecentChanges ) {